package com.example.blog_springboot.api;

import com.example.blog_springboot.model.Blog;
import com.example.blog_springboot.model.User;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RequestMapping("/blog")
public interface BlogRest {
    @RequestMapping(value = "/selectAll", method = RequestMethod.GET)
    List<Blog> selectAll();

    @RequestMapping(value = "/selectOne", method = RequestMethod.GET)
    Blog selectOne(String blogId) throws Exception;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    void add(Blog blog,@SessionAttribute("user") User user) throws Exception;

    @RequestMapping(value = "/delete",method = RequestMethod.DELETE)
    void delete(String blogId, @SessionAttribute("user")User user) throws Exception;

    @RequestMapping(value = "/count", method = RequestMethod.GET)
    int count();
}